//-----------------------------------------------------------------------
// <copyright file="CardColor.cs" company="Bugger Sisters Inc.">
//     Copyright (c) Bugger Sisters Inc. All rights reserved.
// </copyright>
// <author>Sergey Tyshkovets</author>
//-----------------------------------------------------------------------

namespace MagicTheGathering.Core
{
    using System;
    using System.Collections.Generic;
    using CardColors = Enums.CardColors;

    public class CardColor : FlagSet<CardColor, CardColors> 
    {
        private HashSet<CardColors> cardColors
        {
            get
            {
                return items;
            }
        }

        protected CardColor(CardColors color) : base(color)
        {
        }

        public CardColor()
        {
        }

        #region [Color-specific methods]

        public Boolean IsUncolored()
        {
            return cardColors.Count == 0;
        }

        public Boolean IsFullColored()
        {
            return cardColors.Count == 5;
        }

        public Boolean IsMultiColored()
        {
            return cardColors.Count > 1;
        }
        
        #endregion

        #region [Static single colors]

        public static CardColor Red
        {
            get
            {
                return new CardColor(CardColors.Red);
            }
        }

        public static CardColor Green
        {
            get
            {
                return new CardColor(CardColors.Green);
            }
        }

        public static CardColor White
        {
            get
            {
                return new CardColor(CardColors.White);
            }
        }

        public static CardColor Blue
        {
            get
            {
                return new CardColor(CardColors.Blue);
            }
        }

        public static CardColor Black
        {
            get
            {
                return new CardColor(CardColors.Black);
            }
        }

        #endregion
    }
}